#ifndef ITEM_H
#define ITEM_H

#include <QLabel>
#include <QMouseEvent>

class Item : public QWidget {
    Q_OBJECT
public:
    explicit Item(int id, QWidget *qWidget, QObject *object = 0);
    void setDesc(QString desc);
    void setImg(QString img);
    QPoint getPosInMainWindow(QWidget *qWidget);

public slots:
    void getMouseEnterSlot(int id, bool isEnter);
    void mouseMoveEventSlot(QMouseEvent* event);
    void mousePressEventSlot(QMouseEvent *event);

signals:
    void setDescSig(const QString& desc);

private:
    int id;
    QWidget *qWidget;
    QString desc;
    QString img;

    void showDetail(QWidget *qWidget);
    void disableDetail(QWidget *qWidget);
    bool enterQWidget(QPoint pp, QWidget* qWidget);
    QWidget * findMainWindowsWidget(QWidget *qWidget);

};

#endif // ITEM_H
